package org.grottarossa.domain;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Serialized;

import java.util.Set;

@PersistenceCapable(identityType = IdentityType.DATASTORE, detachable = "true")
public class User 
{
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
	@Serialized
	private String user_id;

	@Persistent	
	private String firstName;	
	
	@Persistent
	private String lastNameName;
	
	@Persistent
	private String email;

	@Persistent
	private long createTime = System.currentTimeMillis();
	
	@Persistent
	private Set<Role> roles;

	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param lastNameName the lastNameName to set
	 */
	public void setLastNameName(String lastNameName) {
		this.lastNameName = lastNameName;
	}

	/**
	 * @return the lastNameName
	 */
	public String getLastNameName() {
		return lastNameName;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

}
